package com.disdr.bean.组长提成规则;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;

public class 组长提成规则转义 {


    public static void main(String[] args) throws IOException {
        FileReader fileReader = new FileReader("src\\main\\java\\com\\disdr\\bean\\组长提成规则\\组长提成规则.txt");
        BufferedReader br = new BufferedReader(fileReader);
        String line = br.readLine();

        String 续卡状态 = "";
        String 卡种 = "";

        for(;line!=null;line = br.readLine()){
            String[] str = line.split("\t");

            //1-预首续 2-非预首续
            if("首续".equals(str[0])){
                续卡状态 = "1_";
            }else if("非首续".equals(str[0])){
                续卡状态 = "2_";
            }
            //1年卡;2半年卡;3季卡
            if("年卡".equals(str[1])){
                卡种 = "1_";
            }else if("半年卡".equals(str[1])){
                卡种 = "2_";
            }else if("季卡".equals(str[1])){
                卡种 = "3_";
            }
            //1-教练 2-组长
            //1-中级 2-高级 3-资深
            if("组长".equals(str[2])){
                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"2_1\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"2_1\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"2_1\", new BigDecimal("+str[5]+"));");

                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"2_2\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"2_2\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"2_2\", new BigDecimal("+str[5]+"));");

                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"2_3\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"2_3\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"2_3\", new BigDecimal("+str[5]+"));");
            }else if("教练-中级".equals(str[2])){
                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"1_1\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"1_1\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"1_1\", new BigDecimal("+str[5]+"));");
            }else if("教练-高级".equals(str[2])){
                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"1_2\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"1_2\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"1_2\", new BigDecimal("+str[5]+"));");
            }else if("教练-资深".equals(str[2])){
                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"1_3\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"1_3\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"1_3\", new BigDecimal("+str[5]+"));");
            }else if("教练-中/高/资深".equals(str[2])){
                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"1_1\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"1_1\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"1_1\", new BigDecimal("+str[5]+"));");

                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"1_2\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"1_2\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"1_2\", new BigDecimal("+str[5]+"));");

                System.out.println("rewardRule.put(\"4301_"+续卡状态+卡种+"1_3\", new BigDecimal("+str[3]+"));");
                System.out.println("rewardRule.put(\"3201_"+续卡状态+卡种+"1_3\", new BigDecimal("+str[4]+"));");
                System.out.println("rewardRule.put(\"3205_"+续卡状态+卡种+"1_3\", new BigDecimal("+str[5]+"));");
            }

        }
    }
}
